package com.afei.java.ai.langchain4j.config;

import dev.langchain4j.memory.ChatMemory;
import dev.langchain4j.memory.chat.MessageWindowChatMemory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Title: MemoryChatAssisantConfig
 * @Author wangyf
 * @Package com.afei.java.ai.langchain4j.config
 * @Date 2025/4/23 10:31
 * @description: 记忆体配置
 */

@Configuration
public class MemoryChatAssisantConfig {

    @Bean
    public ChatMemory chatMemory(){

        return  MessageWindowChatMemory.withMaxMessages(10);

    }
}
